@echo off
set SQLSERVER=
set SQLUID=
set SQLPWD=
set SQLDATABASE=


echo Step 1 Creating Tables...

osql -S %SQLSERVER% -U %SQLUID% -P %SQLPWD% -d %SQLDATABASE% -n -i "Tables\DimAddress.sql"
osql -S %SQLSERVER% -U %SQLUID% -P %SQLPWD% -d %SQLDATABASE% -n -i "Tables\DimCommodity.sql"
osql -S %SQLSERVER% -U %SQLUID% -P %SQLPWD% -d %SQLDATABASE% -n -i "Tables\DimCommodityGroup.sql"
osql -S %SQLSERVER% -U %SQLUID% -P %SQLPWD% -d %SQLDATABASE% -n -i "Tables\DimDate.sql"
osql -S %SQLSERVER% -U %SQLUID% -P %SQLPWD% -d %SQLDATABASE% -n -i "Tables\DimDeliveryType.sql"
osql -S %SQLSERVER% -U %SQLUID% -P %SQLPWD% -d %SQLDATABASE% -n -i "Tables\DimDivision.sql"
osql -S %SQLSERVER% -U %SQLUID% -P %SQLPWD% -d %SQLDATABASE% -n -i "Tables\DimMerchant.sql"
osql -S %SQLSERVER% -U %SQLUID% -P %SQLPWD% -d %SQLDATABASE% -n -i "Tables\DimSubMerchant.sql"
osql -S %SQLSERVER% -U %SQLUID% -P %SQLPWD% -d %SQLDATABASE% -n -i "Tables\DimFactSales.sql"


echo Step 2 Creating Procedures...

osql -S %SQLSERVER% -U %SQLUID% -P %SQLPWD% -d %SQLDATABASE% -n -i "Procedures\dbo.p_DimAddress_Insert.sql"
osql -S %SQLSERVER% -U %SQLUID% -P %SQLPWD% -d %SQLDATABASE% -n -i "Procedures\dbo.p_DimAddress_Update.sql"
osql -S %SQLSERVER% -U %SQLUID% -P %SQLPWD% -d %SQLDATABASE% -n -i "Procedures\dbo.p_DimCommodity_Insert.sql"
osql -S %SQLSERVER% -U %SQLUID% -P %SQLPWD% -d %SQLDATABASE% -n -i "Procedures\dbo.p_DimCommodity_Update.sql"
osql -S %SQLSERVER% -U %SQLUID% -P %SQLPWD% -d %SQLDATABASE% -n -i "Procedures\dbo.p_DimCommodityGroup_Insert.sql"
osql -S %SQLSERVER% -U %SQLUID% -P %SQLPWD% -d %SQLDATABASE% -n -i "Procedures\dbo.p_DimCommodityGrouo_Update.sql"
osql -S %SQLSERVER% -U %SQLUID% -P %SQLPWD% -d %SQLDATABASE% -n -i "Procedures\dbo.p_DimCustomer_Insert.sql"
osql -S %SQLSERVER% -U %SQLUID% -P %SQLPWD% -d %SQLDATABASE% -n -i "Procedures\dbo.p_DimCustomer_Update.sql"
osql -S %SQLSERVER% -U %SQLUID% -P %SQLPWD% -d %SQLDATABASE% -n -i "Procedures\dbo.p_DimDeliveryType_Insert.sql"
osql -S %SQLSERVER% -U %SQLUID% -P %SQLPWD% -d %SQLDATABASE% -n -i "Procedures\dbo.p_DimDeliveryType_Update.sql"
osql -S %SQLSERVER% -U %SQLUID% -P %SQLPWD% -d %SQLDATABASE% -n -i "Procedures\dbo.p_DimDivision_Insert.sql"
osql -S %SQLSERVER% -U %SQLUID% -P %SQLPWD% -d %SQLDATABASE% -n -i "Procedures\dbo.p_DimDivision_Update.sql"
osql -S %SQLSERVER% -U %SQLUID% -P %SQLPWD% -d %SQLDATABASE% -n -i "Procedures\dbo.p_DimMerchant_Insert.sql"
osql -S %SQLSERVER% -U %SQLUID% -P %SQLPWD% -d %SQLDATABASE% -n -i "Procedures\dbo.p_DimMerchant_Update.sql"
osql -S %SQLSERVER% -U %SQLUID% -P %SQLPWD% -d %SQLDATABASE% -n -i "Procedures\dbo.p_DimSubMerchant_Insert.sql"
osql -S %SQLSERVER% -U %SQLUID% -P %SQLPWD% -d %SQLDATABASE% -n -i "Procedures\dbo.p_DimSubMerchant_Update.sql"
osql -S %SQLSERVER% -U %SQLUID% -P %SQLPWD% -d %SQLDATABASE% -n -i "Procedures\dbo.p_FactSales_Insert.sql"

echo Completed
